<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../../vue.js"></script>
</head>
<body>
<div id="app">
    <button v-on:click="count++">点击次数： {{count}}</button>
</div>

<div id="app-2">
    <button v-on:click="sayHi">Greeting!</button>
</div>

<div id="app-3">
    <button v-on:click="sayHi('Hello')">Hi</button>
</div>

<script>
    var app = new Vue({
        el: "#app",
        data: {
            count: 0
        }
    })

    var app2 = new Vue({
        el: "#app-2",
        methods: {
            sayHi: function (){
                alert("Hi!")
            }
        }
    })

    var app3 = new Vue({
        el: "#app-3",
        methods: {
            sayHi: function (str){
                alert(str)
                // console.log(e);
            }
        }
    })
</script>

</body>
</html>